﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebStudio.Business.Entity;
using WebStudio.Business.Rule;

public partial class AlbumDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            rptAlbumBind();
            getPageTitle();
        }
    }

    private int PAlbumId
    {
        get
        {
            if (string.IsNullOrEmpty(Request.QueryString["pid"]))
            {
                return -1;
            }
            else
            {
                int PID = -1;
                try
                {
                    PID = Convert.ToInt32(Request.QueryString["pid"]);
                }
                catch
                {
                    return -1;
                }
                return PID;
            }
        }
    }

    private void getPageTitle()
    {
        AlbumEntity albumEntity = new AlbumEntity();
        albumEntity = AlbumRule.GetAlbumEntity(PAlbumId);
        this.Title = albumEntity.AlbumName;
    }

    private void rptAlbumBind()
    {
        rptAlbum.DataSource = AlbumRule.GetAlbumList("ParentId=" + PAlbumId + "");
        rptAlbum.DataBind();
    }
}
